struct DXToVertex
{
   float3 Position	:POSITION;
   float2 TexCoord	:TEXCOORD0;
};

struct VertexToPixel
{
    float4 Position :POSITION;
    float2 TexCoord	:TEXCOORD0;
};

float4x4 xWorldViewProj;

Texture xSkyTexture;

sampler texSampler = sampler_state 
{
	texture = <xSkyTexture>; 
	magfilter = LINEAR; 
	minfilter = LINEAR; 
	mipfilter = LINEAR; 
	AddressU = mirror; 
	AddressV = mirror;
};

VertexToPixel SkyboxVertexShader(DXToVertex In)
{
	VertexToPixel Output = (VertexToPixel) 0;
	Output.Position = mul(float4(In.Position, 1), xWorldViewProj);
    Output.TexCoord = In.TexCoord.xy;
    return Output; 
}

float4 SkyboxPixelShader(VertexToPixel In) : COLOR0
{
	return tex2D(texSampler, In.TexCoord.xy);
}

technique SkyboxTechnique
{
    pass Pass0
    {        
		AlphaBlendEnable = false;
		ZWriteEnable = true;  
		CullMode = CW;

        VertexShader = compile vs_1_1 SkyboxVertexShader();
        PixelShader = compile ps_2_0 SkyboxPixelShader();
    }
}
